// https://kenlea.blog/net-7-console-app-with-serilog-step-by-step-instructions
using Huioo.Learning.Serilog.WorkerService;
using Serilog;

IHost host = Host.CreateDefaultBuilder(args)
    .ConfigureHostConfiguration(configHost =>
    {
        //configHost.SetBasePath(Directory.GetCurrentDirectory());
        //configHost.AddJsonFile("appsettings.json", optional: true);
    })
    .ConfigureServices(services =>
    {
        services.AddHostedService<Worker>();
    })
    .UseSerilog((context, configuration) =>
    {
        var config = context.Configuration.GetSection("Serilog");
        configuration.ReadFrom.Configuration(config);
        //configuration.ReadFrom.Configuration(context.Configuration);
    })
    .Build();

await host.RunAsync();
